#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int my_strlen(char* p)
{  
	int i = 0;
	while(*p != '\0')
	{
		i++; p++;
	}
	return i;
}
void my_strcpy(char* p, char* w)
{
	do{
		*p = *w;
		w++;
		p++;

	} while (*p != '\0');
}
int my_strcmp(char* p, char* w)
{
	while (1)
	{
		if (*p > *w)
			return 1;
		if (*p < *w)
			return-1;
		if (*p == '\0' && *w == '\0')
			return 0;
		p++, w++;
	}
}
void my_stract(char* p, char* w)
{
	while (*++p != '\0');
		do
		{
			*p = *w;
				p++, w++;
			
		}while (*p == '\0');
}
char* my_strstr(char* p, char* p1)
{
	char* a = p1;
	char* b = p;
	char* c = p;
	while (*b != '\0')
	{		
			while (*c==*a)
			{
				c++, a++;
				if (*a == '\0')
					return b;
			}
		a = p1; b++; c = b;
	}
	return NULL;
}
int main()
{
	char arr[100] = "qwerasd";
	char arr1[100] = "a";
	printf("%d",my_strcmp(arr, arr1));
	printf("%d",my_strlen(arr));
	char* ret = my_strstr(arr, arr1);
	printf("%s", ret);my_strcpy(arr, arr1);
	printf("%s",arr);my_stract(arr, arr1);
	printf("%s", arr);
}










